//
//  ButtonsBootcamp.swift
//  swiftUiTest
//
//  Created by Mac on 2023/6/29.
//

import SwiftUI

struct ButtonsBootcamp_19: View {
    
    @State var title: String = "This is my title"
    
    var body: some View {
        VStack(spacing:20) {
            
            HStack {
                Text(title)
                    .font(.largeTitle)
            }
            Button("Press me!") {
                self.title = "Button was pressed";
            }
            .accentColor(.green)
            .padding()
            
            Button {
                self.title = "ok ok"
            } label: {
                Text("save".uppercased())
                    .font(.title3)
                    .fontWeight(.bold)
                    .foregroundColor(.white)
                    .padding(.all)
                    .padding(.horizontal,20)
                    .background(
                        Color.blue
                            .cornerRadius(10)
                            .shadow(radius: 10)
                    )
            }
            
            Button {
                self.title = "Button #3"
            } label: {
                Circle()
                    .fill(Color.white)
                    .frame(width: 75.0, height: 75.0)
                    .shadow(radius: 10)
                    .overlay(
                        Image(systemName: "heart.fill")
                            .font(.largeTitle)
                            .foregroundColor(.red)
                    )
            }
            
            Button {
                self.title = "Button #4"
            } label: {
                Text("Finish".uppercased())
                    .bold()
                    .foregroundColor(.gray)
                    .padding(.all)
                    .padding(.horizontal,10)
                    .background(
                         Capsule()
                            .stroke(Color.gray,lineWidth: 2.0)
                    )
            }



         
        }
    }
}

struct ButtonsBootcamp_Previews: PreviewProvider {
    static var previews: some View {
        ButtonsBootcamp_19()
    }
}
